const bannerProps = require('../tw-lib-base/banner-document/props')

module.exports = {
  ...bannerProps,

  imageListFromProp: {
    type: Array,
    default () {
      return []
    },
    name: '图片列表',
    nameTip: '可在数据管理中设置图片列表，优先级高于当前属性的优先级，如果上传的图片需要指定跳转地址，可先在此处上传图片，再复制上传的地址，然后在数据管理中设置图片跳转的href',
    filedType: 'file',
    limit: 1,
    maxSize: 1024,
    vif: {
      key: 'type',
      value: 'images'
    }
  },

  imageListFromApi: {
    type: Array,
    default () {
      return [
        {
          title: '图片',
          url: "https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3153405721,1524067674&fm=26&gp=0.jpg",
          href: 'http://www.baidu.com',
          target: '_blank'
        },
        {
          title: '图片',
          url: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Ffile2.renrendoc.com%2Ffileroot_temp3%2F2021-3%2F22%2F6d6d4388-7021-4580-9c52-5676233033d2%2F6d6d4388-7021-4580-9c52-5676233033d23.gif&refer=http%3A%2F%2Ffile2.renrendoc.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1621569308&t=490e69fe1bbde0916c6b733b58404a87',
          href: 'http://www.baidu.com',
          target: '_blank'
        },
        {
          title: '图片',
          url: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic35.nipic.com%2F20131120%2F12871060_175530215154_2.jpg&refer=http%3A%2F%2Fpic35.nipic.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1621569308&t=ea8ddb2ebf462405243a482c50629893',
          href: 'http://www.baidu.com',
          target: '_blank'
        }
      ]
    },
    name: '图片列表(从api获取)',
    nameTip: '此处图片列表的优先级高于属性中的图片列表的优先级，以下为属性解释：\nurl:图片路径，必须\ntitle:图片标题\nbackgroundColor:图片背景色\nhref:图片跳转地址\ntarget:是否在当前窗口打开链接,默认在当前窗口打开，为_blank时在新窗口打开',
    filedType: 'api',
    vif: {
      key: 'type',
      value: 'images'
    }
  },
  maxWidth: {
    type: String,
    default: '1400px',
    name: '最大宽度',
    filedType: 'string'
  },
  slideWidth: {
    type: String,
    default: 900,
    name: '幻灯片宽度',
    nameTip: '显示在转盘中间',
    filedType: 'string'
  },

  slideHeight: {
    type: String,
    default: 506,
    name: '幻灯片高度',
    nameTip: '显示在转盘中间',
    filedType: 'string'
  },

  selfadapt: {
    type: Boolean,
    default: true,
    name: '开启自适应',
    nameTip: '按照给的高宽的比例来计算',
    filedType: 'switch'
  },

  display: {
    type: String,
    default: 3,
    name: '每页展示个数',
    filedType: 'string'
  },

  startIndex: {
    type: String,
    default: 0,
    name: '开始幻灯片索引',
    nameTip: '第一张幻灯片的索引为0',
    filedType: 'string'
  },

  animationSpeed: {
    type: String,
    default: 500,
    name: '速度',
    filedType: 'string'
  },

  border: {
    type: String,
    default: 0,
    name: '图片边框',
    filedType: 'string'
  },

  space: {
    type: String,
    default: 400,
    name: '幻灯片间隔',
    filedType: 'string'
  },

  perspective: {
    type: String,
    default: 0,
    name: '幻灯片透视位置',
    filedType: 'string'
  },

  inverseScaling: {
    type: String,
    default: 180,
    name: '缩放',
    filedType: 'string'
  },

  oneDirectional: {
    type: Boolean,
    default: false,
    name: '开启动画方向',
    filedType: 'switch'
  },

  direction: {
    type: String,
    default: 'ltr',
    name: '动画方向',
    filedType: 'select',
    options: [
      {
        name: '从左到右',
        value: 'ltr'
      },
      {
        name: '从右到左',
        value: 'rtl'
      }
    ],
    vif: {
      key: 'oneDirectional',
      value: true
    }
  },

  autoplayEnabled: {
    type: Boolean,
    default: true,
    name: '开启自动播放',
    filedType: 'switch'
  },

  autoplayTimeout: {
    type: String,
    default: 2000,
    name: '自动播放时间',
    filedType: 'string',
    vif: {
      key: 'autoplayEnabled',
      value: true
    }
  },

  imageTitleVisibal: {
    type: Boolean,
    default: true,
    name: '开启标题',
    filedType: 'switch'
  },

  dots: {
    type: Boolean,
    default: true,
    name: '开启控件点',
    filedType: 'switch'
  },

  controlsVisible: {
    type: Boolean,
    default: false,
    name: '开启控件箭头',
    filedType: 'switch'
  },

  loop: {
    type: Boolean,
    default: true,
    name: '开启循环',
    filedType: 'switch'
  },

  clickable: {
    type: Boolean,
    default: true,
    name: '开启点击',
    filedType: 'switch'
  },

  disable3d: {
    type: Boolean,
    default: false,
    name: '关闭3D',
    filedType: 'switch'
  },

  objectFit: {
    type: String,
    default: 'contain',
    name: '图片填充模式',
    filedType: 'select',
    options: [
      {
        name: '无',
        value: 'none'
      },
      {
        name: '填充',
        value: 'fill'
      },
      {
        name: '缩放',
        value: 'contain'
      },
      {
        name: '覆盖',
        value: 'cover'
      }
    ]
  }
}
